package com.training.admin.entity.search;

import java.util.Map;

import com.demo2do.core.persistence.support.QueryFilter;
import com.demo2do.core.persistence.support.QueryOrder;

/**
 *
 * @author Rockett
 *
 */
public class DynamicReportSearch extends ReportSearch{

   

    private QueryFilter filter;
    
    private QueryOrder order;
    private String col1;
    private String col2;
    private String col3;
    private String col4;
    private String col5;
    private String col6;
    private String col7;
    private String col8;
    private String col9;
    private String col10;
    private String col11;
    private String col12;
    private String col13;
    private String col14;
    private String col15;
    private String col16;
    private String col17;
    private String col18;
    private String col19;
    private String col20;
    private String col21;
    private String col22;
    private String col23;
    private String col24;
    private String col25;
    
    /**
     * dynamic report id
     */
    private Long reportId;
    
    /**
     * The default constructor
     */
    public DynamicReportSearch() {
        order = new QueryOrder("col1", "asc");
    }
    /* (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#getPreparedFilter(boolean)
     */
    public QueryFilter getPreparedFilter(boolean refresh) {
    	
        if (filter == null || refresh) {
        	
            filter = new QueryFilter().addLike("col1", 	col1)
            		.addLike("col2",	col2)
            		.addLike("col3",	col3)
            		.addLike("col4",	col4)
            		.addLike("col5",	col5)
            		.addLike("col6",	col6)
            		.addLike("col7",	col7)
            		.addLike("col8",	col8)
            		.addLike("col9",	col9)
            		.addLike("col10",	col10)
            		.addLike("col11",	col11)
            		.addLike("col12",	col12)
            		.addLike("col13",	col13)
            		.addLike("col14",	col14)
            		.addLike("col15",	col15)
            		.addLike("col16",	col16)
            		.addLike("col17",	col17)
            		.addLike("col18",	col18)
            		.addLike("col19",	col19)
            		.addLike("col20",	col20)
            		.addLike("col21",	col21)
            		.addLike("col22",	col22)
            		.addLike("col23",	col23)
            		.addLike("col24",	col24)
            		.addLike("col25",	col25)
            		.addEquals("dynamicReport.id", reportId);
            
        }
        
        return filter;
        
    }
    
 
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#buildSentenceTemplate()
     */
    public String buildSentenceTemplate() {
        String sentence = "FROM DynamicReportData  where disabled = false " + getPreparedFilter(false).clauseSentence() + order.sentence();
        return sentence;
    }

    /*
     * (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#buildParameters()
     */
    public Map<String, Object> buildParameters() {
        return getPreparedFilter(false).parameters();
    }
    

    /**
     * 
     * @return
     */
    public QueryFilter getFilter(){
        return getPreparedFilter(false);
    }
	/**
	 * @return the order
	 */
	public QueryOrder getOrder() {
		return order;
	}
	/**
	 * @return the col1
	 */
	public String getCol1() {
		return col1;
	}
	/**
	 * @param col1 the col1 to set
	 */
	public void setCol1(String col1) {
		this.col1 = col1;
	}
	/**
	 * @return the col2
	 */
	public String getCol2() {
		return col2;
	}
	/**
	 * @param col2 the col2 to set
	 */
	public void setCol2(String col2) {
		this.col2 = col2;
	}
	/**
	 * @return the col3
	 */
	public String getCol3() {
		return col3;
	}
	/**
	 * @param col3 the col3 to set
	 */
	public void setCol3(String col3) {
		this.col3 = col3;
	}
	/**
	 * @return the col4
	 */
	public String getCol4() {
		return col4;
	}
	/**
	 * @param col4 the col4 to set
	 */
	public void setCol4(String col4) {
		this.col4 = col4;
	}
	/**
	 * @return the col5
	 */
	public String getCol5() {
		return col5;
	}
	/**
	 * @param col5 the col5 to set
	 */
	public void setCol5(String col5) {
		this.col5 = col5;
	}
	/**
	 * @return the col6
	 */
	public String getCol6() {
		return col6;
	}
	/**
	 * @param col6 the col6 to set
	 */
	public void setCol6(String col6) {
		this.col6 = col6;
	}
	/**
	 * @return the col7
	 */
	public String getCol7() {
		return col7;
	}
	/**
	 * @param col7 the col7 to set
	 */
	public void setCol7(String col7) {
		this.col7 = col7;
	}
	/**
	 * @return the col8
	 */
	public String getCol8() {
		return col8;
	}
	/**
	 * @param col8 the col8 to set
	 */
	public void setCol8(String col8) {
		this.col8 = col8;
	}
	/**
	 * @return the col9
	 */
	public String getCol9() {
		return col9;
	}
	/**
	 * @param col9 the col9 to set
	 */
	public void setCol9(String col9) {
		this.col9 = col9;
	}
	/**
	 * @return the col10
	 */
	public String getCol10() {
		return col10;
	}
	/**
	 * @param col10 the col10 to set
	 */
	public void setCol10(String col10) {
		this.col10 = col10;
	}
	/**
	 * @return the col11
	 */
	public String getCol11() {
		return col11;
	}
	/**
	 * @param col11 the col11 to set
	 */
	public void setCol11(String col11) {
		this.col11 = col11;
	}
	/**
	 * @return the col12
	 */
	public String getCol12() {
		return col12;
	}
	/**
	 * @param col12 the col12 to set
	 */
	public void setCol12(String col12) {
		this.col12 = col12;
	}
	/**
	 * @return the col13
	 */
	public String getCol13() {
		return col13;
	}
	/**
	 * @param col13 the col13 to set
	 */
	public void setCol13(String col13) {
		this.col13 = col13;
	}
	/**
	 * @return the col14
	 */
	public String getCol14() {
		return col14;
	}
	/**
	 * @param col14 the col14 to set
	 */
	public void setCol14(String col14) {
		this.col14 = col14;
	}
	/**
	 * @return the col15
	 */
	public String getCol15() {
		return col15;
	}
	/**
	 * @param col15 the col15 to set
	 */
	public void setCol15(String col15) {
		this.col15 = col15;
	}
	/**
	 * @return the col16
	 */
	public String getCol16() {
		return col16;
	}
	/**
	 * @param col16 the col16 to set
	 */
	public void setCol16(String col16) {
		this.col16 = col16;
	}
	/**
	 * @return the col17
	 */
	public String getCol17() {
		return col17;
	}
	/**
	 * @param col17 the col17 to set
	 */
	public void setCol17(String col17) {
		this.col17 = col17;
	}
	/**
	 * @return the col18
	 */
	public String getCol18() {
		return col18;
	}
	/**
	 * @param col18 the col18 to set
	 */
	public void setCol18(String col18) {
		this.col18 = col18;
	}
	/**
	 * @return the col19
	 */
	public String getCol19() {
		return col19;
	}
	/**
	 * @param col19 the col19 to set
	 */
	public void setCol19(String col19) {
		this.col19 = col19;
	}
	/**
	 * @return the col20
	 */
	public String getCol20() {
		return col20;
	}
	/**
	 * @param col20 the col20 to set
	 */
	public void setCol20(String col20) {
		this.col20 = col20;
	}
	/**
	 * @return the col21
	 */
	public String getCol21() {
		return col21;
	}
	/**
	 * @param col21 the col21 to set
	 */
	public void setCol21(String col21) {
		this.col21 = col21;
	}
	/**
	 * @return the col22
	 */
	public String getCol22() {
		return col22;
	}
	/**
	 * @param col22 the col22 to set
	 */
	public void setCol22(String col22) {
		this.col22 = col22;
	}
	/**
	 * @return the col23
	 */
	public String getCol23() {
		return col23;
	}
	/**
	 * @param col23 the col23 to set
	 */
	public void setCol23(String col23) {
		this.col23 = col23;
	}
	/**
	 * @return the col24
	 */
	public String getCol24() {
		return col24;
	}
	/**
	 * @param col24 the col24 to set
	 */
	public void setCol24(String col24) {
		this.col24 = col24;
	}
	/**
	 * @return the col25
	 */
	public String getCol25() {
		return col25;
	}
	/**
	 * @param col25 the col25 to set
	 */
	public void setCol25(String col25) {
		this.col25 = col25;
	}
	/**
	 * @return the reportId
	 */
	public Long getReportId() {
		return reportId;
	}
	/**
	 * @param reportId the reportId to set
	 */
	public void setReportId(Long reportId) {
		this.reportId = reportId;
	}




}
